lib/repo-finder: Avoid a potential unref-of-NULL crash
authorPhilip Withnall <withnall@endlessm.com>
Mon, 7 Aug 2017 18:49:17 +0000 (19:49 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 8 Aug 2017 13:59:58 +0000 (13:59 +0000)
commit0d2a9a79090a2d3bbe3f638018c473c4cc2f3b11
tree8d095c315190c7f3d1679a0d2ed48fad2647b250
parentbe4832242da27887399eb0c0bb7be1378d858b14
lib/repo-finder: Avoid a potential unref-of-NULL crash

As the comment explains, it’s possible for a result to be freed while
ref_to_checksum is NULL, even though normally the data structure
guarantees it’s non-NULL. This was causing crashes when results were
filtered out of a find-remotes call. Guard against that.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #1058
Approved by: cgwalters
src/libostree/ostree-repo-finder.c